home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
ddj0796.zip
/
letters.796
< prev
next >
Wrap
Text File
|
1996-05-22
|
1KB
|
64 lines
_Letters to the Editor_
Example 1
by Martin Brown
(a)
ln( 1+x ) = x - x^2/2 + x^3/3 - ...
ln(1) = 0, ln(2) = 0.833333 max error = 0.14 ( 20% )
(b)
P{ ln( 1+x ) } = x*(6+x)/(6+4x)
ln(1) = 0, ln(2) = 0.7 max error = 0.00685 ( < 1% )
rms error = 0.00258
(c)
p'{ ln( 1+x ) } = x*(6 + 0.7662x)/(5.9897 + 3.7658x)
ln(1) = 0, ln(2) = 0.69358 max error = 4.3E-4 ( < 0.1 % )
rms = 1.5E-4
(d)
y = x/(2+x)
(e)
ln( (1+y)/(1-y) ) = 2y + 2y^3/3 + 2y^5/5 + ...
ln(1) = 0, ln(2) = 0.69300 max error = -0.00014
(f)
P{ ln (1+y)/(1-y) } = 2y*(15 - 4y^2)/(15 - 9y^2)
ln(1) = 0, ln(2) = 0.693122 max error = -0.000025
(g)
P{ sqrt(1+x) } = (4 + 3x)/(4 + x)
Example 2
by Carl Smotricz
/*** y = log2(x) for 1 <= x < 2 ***/
#define RESULT_BITS 40 // desired accuracy
s = 1.0;
for (n=RESULT_BITS; n--; ) {
x *= x;
s /= 2.0;
if (x >= 2.0) {
y += s;
x /= 2.0;
}
}